<!-- modified https://github.com/rundocs/jekyll-rtd-theme/blob/master/_includes/breadcrumbs.liquid -->
{% if page.notopnavigation != true %}
<div role="navigation" aria-label="breadcrumbs navigation">
    <ul class="wy-breadcrumbs">
        <li>
            <a href="{{ site.baseurl }}/" class="icon icon-home"></a><i class="fa fa-angle-double-right"></i>
        </li>
        {%- case page.url -%}
            {%- when "/search.html" %}
                <li>{{ __search }}</li>
            {%- when "/404.html" %}
                <li>{{ __404 }}</li>
            {%- else -%}
                {%- assign blocks = page.path | split: "/" -%}
                {%- assign length = blocks | size -%}
                {%- if page.dir == page.url and page.url != "/" -%}
                    {%- assign length = blocks | size | minus: 1 -%}
                {%- endif -%}
                {%- for block in blocks limit: length -%}
                    {%- if forloop.last %}
                        <li><span class="page-title-last">{{ page.title }}</span></li>
                    {%- else -%}
                        {%- capture href -%}
                            {{ site.baseurl }}/{% for block in blocks limit: forloop.index %}{{ block | append: "/" }}{% endfor %}
                        {%- endcapture %}
                        {%- capture rel_href -%}
                            /{% for block in blocks limit: forloop.index %}{{ block | append: "/" }}{% endfor %}
                        {%- endcapture %}
                        <li>
                            {%- assign parent_title = block -%}
                            {%- for lookup_page in site.pages -%}
                                {% if lookup_page.url == rel_href %}
                                    {%- assign parent_title = lookup_page.title -%}
                                {% endif %}
                            {%- endfor -%}
                            <a href="{{ href }}">{{ parent_title }}</a><i class="fa fa-angle-double-right"></i>
                        </li>
                    {%- endif -%}
                {%- endfor -%}
        {%- endcase %}
    </ul>
    <hr>
</div>
{% endif %}
